package com.ats.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ats.service.UserSerivce_xh;
import com.ats.serviceimpl.UserServiceImpl_xh;

/**
 * 验证用户名
 * @author xh
 *
 */
public class FindUnameController_xh extends HttpServlet{
	UserSerivce_xh us = new UserServiceImpl_xh();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		String uname =req.getParameter("uname");
		PrintWriter  pw = resp.getWriter();
		boolean flag =us.FindUserByName(uname);
		pw.write(flag+"");
		pw.flush();
		pw.close();
	}
}
